package com.wenjie.gateway.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author wenjie
 * @Description 客户端类型
 * @date 2024/6/8 20:43
 */
@Getter
public enum ClentType {

    BACK_END(1, "后台"),
    CLIENT_SIDE(2, "客户端");
    private final Integer code;
    private final String mark;

    ClentType(Integer code, String mark) {
        this.code = code;
        this.mark = mark;
    }


    /**
     * @Description 通过code进行查询枚举值
     * @author wenjie
     * @date 2024/5/30 15:21
     */
    public static ClentType getBycode(Integer code) {
        return Arrays.stream(ClentType.values()).filter(s -> s.getCode().equals(code)).findFirst().orElse(null);
    }


}
